//
//  HTTPTarget.swift
//  Solo
//
//  Created by JunMing on 2022/8/26.
//  Copyright © 2021 赵俊明. All rights reserved.
//

import UIKit

enum Doman {
    case remote
    case local
    case ali
    case tencent
    case mac
    
    var url: String {
        switch self {
        case .remote:
            return "http://119.23.41.43/wp"
        case .local:
            return "http://119.23.41.43/wp"
        case .ali:
            return "http://119.23.41.43/wp"
        case .tencent:
            return "http://124.220.2.58/wp"
        case .mac:
            return "http://192.168.1.41:8000"
        }
    }
}

enum HTTPTarget: String {
    case aichat = "/watch/ai_chat" // 大模型
    case aiasr = "/asr" // 语音转文本
    case tts = "/aitts" // 文本转语音
    case localTTS = "/tts" // 文本转语音
}

struct HttpRequest {
    var port: UInt
    var doman: Doman
    var target: HTTPTarget
    var method: NetManager.ConnectionType
    var url: String { self.doman.url + target.rawValue }
    
    init(doman: Doman, target: HTTPTarget, method: NetManager.ConnectionType = .GET, port: UInt = 8000) {
        self.doman = doman
        self.target = target
        self.port = port
        self.method = method
    }
}
